/**
 * Copyright (c) 2024 Huawei Technologies Co., Ltd
 * [graph-engine] is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *          http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
*/


#ifndef GE_PARSER_ONNX_ONNX_FILE_CONSTANT_PARSER_H_
#define GE_PARSER_ONNX_ONNX_FILE_CONSTANT_PARSER_H_

#include "parser/onnx/onnx_op_parser.h"
#include "proto/onnx/ge_onnx.pb.h"

namespace ge {
class PARSER_FUNC_VISIBILITY OnnxFileConstantParser : public OnnxOpParser {
 public:
  Status ParseParams(const Message *op_src, ge::Operator &op_def) override;

 private:
  Status ParsePath(const ge::onnx::TensorProto &tensor_proto, ge::Operator &op_def) const;
  Status ParseDataType(const ge::onnx::TensorProto &tensor_proto, ge::Operator &op_def) const;
  void ParseShape(const ge::onnx::TensorProto &tensor_proto, ge::Operator &op_def) const;
  Status GetTensorProto(const ge::onnx::NodeProto &node_proto, ge::onnx::TensorProto &tensor_proto) const;
  Status SetPathAttr(const ge::onnx::StringStringEntryProto &string_proto, ge::Operator &op_def) const;
};
}  // namespace ge

#endif  // GE_PARSER_ONNX_ONNX_FILE_CONSTANT_PARSER_H_
